The present disclosure relates to a database technology, and more particularly, to a method and system for supporting imperative graphic queries on a relational database.
With increasing demands for storing and querying graphic structural data, graphic database and graphic query language are developed increasingly, some of which are already widely applied in industry, especially a graphic database of so called Not Only Structured Query Language (NoSQL) family, such as Neo4J™ (Owned by Neo Technology), Infinite Graph® (Owned by Objectivity Inc.), DEX® (Owned by Sparsity Technologies), InfoGrid, and HyperGraphDB. There are two basic graphic query languages in the graphic database: imperative queries (such as Gremlin language, and JRuby language and so on) and declarative queries (such as Cypher, Simple Protocol and RDF Query Language (SPARQL), simple protocol and RDF query language and so on).
The relational database is based on a relational model on a basis of two-dimensional table structure, which has been widely used for a very long time, and developed very well. The current mainstream relational databases may include ORACLE® (Owned by Oracle International Corporation), DB2® (Owned by International Business Machines Corporation), SQLSERVER, SYBASE® (Owned by Sybase Inc.), MYSQL, and so on. However, how to utilize the relational database to efficiently manage and inquiry graphic data, especially how to support imperative queries of graphic database on the relational database, is still an unsolved problem.
Traditional technology only integrates declarative queries (for example Structured Query Language (SQL)) into imperative queries (for example, Java Data Base Connectivity (JDBC)), or only supports declarative queries (for example Cypher, SPARQL and so on). The former method normally causes converting one graphic query into too many primitive queries (for example, JAVA® (Owned by Oracle America, Inc.) codes with JDBC), which greatly degrades query performance. The latter method also causes an inferior expression.
Thus, a technology for supporting imperative graphic queries on a relational database is needed.